<script type="text/javascript">
$(function () {
	var url = '${contextPath}script/oa/leave.js?time=' + sys_get_time();
	$.ajax({url:url, dataType:'script', cache:true,
		success: function(){
		
		}
	});
});
</script>
<#import "/freemarker/modeltype.ftl" as mt>
<div style="width:400px;float:left;">
	<div height="50">
		<form id="editLeaveAgreeForm">
			<table class="table table-striped">
				<tr><td class="table-left">申请人</td>
					<td><input type="text" id="username" name="username" value="${(leave.cuname)!''}" />
						<input type="hidden" id="uc" name="uc" value="${(leave.uc)!''}"/>
						<input type="hidden" id="code" name="code" value="${(leave.code)!''}"/>
						<input type="hidden" id="oc" name="oc" value="${(leave.oc)!''}"/>
						<input type="hidden" id="ct" name="ct" value="${(leave.ct)!''}"/>
						<input type="hidden" id="cu" name="cu" value="${(leave.cu)!''}"/>
						<input type="hidden" id="deleted" name="deleted" value=<#if leave.deleted?? && leave.deleted == false>"false"<#else>"true"</#if>/>
					</td>
				</tr>
				<tr><td class="table-left">开始时间</td>
					<td><input id="start" type="text" name="st" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${(leave.st?string('yyyy-MM-dd'))!''}"></td>
				</tr>
				<tr><td class="table-left">结束时间</td>
					<td><input id="end" type="text" name="et" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="${(leave.et?string('yyyy-MM-dd'))!''}"></td>
				</tr>
				<tr><td class="table-left">请假原因</td>
					<td><textarea id="reason" name="reason" cols="30">${(leave.reason)!''}</textarea></td>
				</tr>
				<tr>
					<#list leave.auditStatusList as list>
					<#if list.status == 2>
						<td class="table-left">备注</td>
						<td><textarea id="remark" name="remark">${(list.remark)!''}</textarea></td>
					<#elseif list.status == 1>
					
					<#else>
						<td class="table-left">备注</td>	
						<td><textarea id="remark" name="remark" placeholder="驳回的话请你填写原因"></textarea></td>
					</#if>
					</#list>
				</tr>
				<#if (leave.auditStatusList?? && leave.auditStatusList?size gt 0)>
					<#list leave.auditStatusList as item>
						<#if item.au??>
							<tr>
								<td colspan="2" style="text-align:center; color: red">已审核</td>
							</tr>
							<tr>
								<td colspan="2" style="text-align:center;"><a class="btn btn-info" href="javascript:;" onclick="javascript: sys_load_handle('leave');">关闭</a></td>
							</tr>
							<#else>
							<tr>
								<td colspan="2" style="text-align: center;">
									<a href="#" class="btn btn-info" onclick="javascript:saveLeaveAgree_leave(); return false;">
										<i class="icon-save"></i> &nbsp;同&nbsp;&nbsp;意
									</a>
									<a href="#" class="btn btn-info" onmousemove="javascript:check_leave();return false;" onclick="javascript:updateDesignate2_leave(${(leave.code)!''}); sys_load_handle('leave'); return false;">
										<i class="icon-save"></i> &nbsp;驳&nbsp;&nbsp;回
									</a>
								</td>
							</tr>
						<#break/>
						</#if>
					</#list>
				</#if>
			</table>
		</form>
	</div>
</div>
